import java.io.IOException;
import java.util.Vector;

import javax.xml.stream.XMLStreamException;


public class ClientNetworkInput extends Thread {

	private networkHandler net;
	private XMLHandler inXML;
	private String cmd;
	
	public ClientNetworkInput(networkHandler net) {
		this.net = net;
		this.cmd = null;
		this.inXML = new XMLHandler();
	}
 	
	
	public void run() {
		while(true) {
			try {
				if( (this.cmd = net.read()) != null) {
					try {
						this.inXML.clear();
						this.inXML.fromXML(this.cmd);
					} catch (XMLStreamException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
				}
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}
	
	public XMLHandler returnCommand() {
		return this.inXML;
	}
}
